from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline

from content import models


class AdditionalyPhraseWordInline(GenericTabularInline):

    model = models.Additionaly
    max_num = 1


@admin.register(models.Word)
class WordAdmin(admin.ModelAdmin):

    list_display = ['translate', 'word', 'part_of_speech', 'updated', 'created']


@admin.register(models.Verb)
class VerbAdmin(admin.ModelAdmin):

    list_display = ['translate', 'word', 'simple_past', 'past_participle', 'part_of_speech', 'updated', 'created']
    prepopulated_fields = {'slug': ('word',)}


@admin.register(models.PartOfSpeech)
class PartOfSpeechAdmin(admin.ModelAdmin):

    list_display = ['name']
